package view;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import javax.swing.JTextField;

import com.pallas.swing.date.DateComboBox;

@SuppressWarnings("serial")
public class PanelVertragSuchen extends JPanel {

	private JTextField textFieldVertragsnummer;
	private JTextField textFieldKundennummer;
	DateComboBox dcbVon;
	DateComboBox dcbBis;
	private JTabbedPane tpane;

	public PanelVertragSuchen(final JTabbedPane tpane) {
		this.tpane=tpane;
		setLayout(null);

		JLabel lblVertragsnummer = new JLabel("Vertragsnummer");
		lblVertragsnummer.setBounds(10, 10, 100, 20);
		add(lblVertragsnummer);

		JLabel lblKundennummer = new JLabel("Kundennummer");
		lblKundennummer.setBounds(10, 35, 100, 20);
		add(lblKundennummer);

		JLabel lblMietzeitraumVom = new JLabel("Mietzeitraum vom");
		lblMietzeitraumVom.setBounds(10, 60, 100, 20);
		add(lblMietzeitraumVom);

		JLabel lblMietzeitraumBis = new JLabel("Mietzeitraum bis");
		lblMietzeitraumBis.setBounds(10, 85, 100, 20);
		add(lblMietzeitraumBis);

		textFieldVertragsnummer = new JTextField();
		textFieldVertragsnummer.setBounds(125, 10, 100, 20);
		add(textFieldVertragsnummer);

		textFieldKundennummer = new JTextField();
		textFieldKundennummer.setBounds(125, 35, 100, 20);
		add(textFieldKundennummer);

		dcbVon = new DateComboBox();
		dcbVon.setBounds(125, 60, 100, 20);
		add(dcbVon);

		dcbBis= new DateComboBox();
		dcbBis.setBounds(125, 85, 100, 20);
		add(dcbBis);

		JButton btnVertragSuchen = new JButton("Vertrag suchen");
		btnVertragSuchen.setBounds(10, 360, 135, 20);
		btnVertragSuchen.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent e) {
				tpane.setEnabledAt(7, true);	
			}
		});
		add(btnVertragSuchen);

		JButton btnAbbrechen = new JButton("Abbrechen");
		btnAbbrechen.setBounds(155, 360, 100, 20);
		add(btnAbbrechen);
	}

}